﻿/*==============================================================*/
/* DBMS name:      ORACLE Version 10g                           */
/* Created on:     2012-6-24 15:26:41                           */
/*==============================================================*/


drop table T_APPROVAL_HISTORY cascade constraints;

drop table T_DELEGATION cascade constraints;

drop table T_DELEGATION_TASK cascade constraints;

drop table T_DEPARTMENT_INNER_TASK cascade constraints;

drop table T_DEPARTMENT_INNER_TASK_REPLY cascade constraints;

drop table T_DICTIONARY cascade constraints;

drop table T_DICTIONARY_RELATION cascade constraints;

drop table T_EXCEPTION_LOG cascade constraints;

drop table T_FLOW_NUMBER cascade constraints;

drop table T_FORM cascade constraints;

drop table T_FORM_DRAFT cascade constraints;

drop table T_INBOX_READ cascade constraints;

drop table T_MESSAGE cascade constraints;

drop table T_MESSAGE_QUEUE cascade constraints;

drop table T_MESSAGE_QUEUE_FINISHED cascade constraints;

drop table T_MESSAGE_TEMPLATE cascade constraints;

drop table T_PERSON_SETTING cascade constraints;

drop table T_PROCESS_BUSINESS_FIELDS cascade constraints;

drop table T_PROCESS_CONFIG cascade constraints;

drop table T_PROCESS_CONFIG_DATAFIELDS cascade constraints;

drop table T_PROCESS_CONFIG_MULTI_PATH cascade constraints;

drop table T_PROCESS_CONFIG_NOTIFICATION cascade constraints;

drop table T_PROCESS_DATA_LOG cascade constraints;

drop table T_REMIND_LOG cascade constraints;

drop table T_SYSTEM_LOG cascade constraints;

drop table T_TASKS cascade constraints;

drop table T_TASK_COMPLETED cascade constraints;

drop table T_TIMEOUT_LOG cascade constraints;

drop table T_UPLOAD_FILE cascade constraints;

drop table T_USER cascade constraints;

drop table T_USER_RELATION cascade constraints;

/*==============================================================*/
/* Table: T_APPROVAL_HISTORY                                    */
/*==============================================================*/
create table T_APPROVAL_HISTORY  (
   HISTORY_ID           CHAR(36)                        not null,
   PROCESS_NAME         NVARCHAR2(50),
   INCIDENT_NO          INT,
   TASK_ID              NVARCHAR2(50),
   STEP_NAME            NVARCHAR2(50),
   ACTION_USER_ID       CHAR(36),
   ACTION_NAME          NVARCHAR2(50),
   ACTION_DATE          DATE,
   DESTINATION_USER     NVARCHAR2(2000),
   COPYTO_USER          NVARCHAR2(1000),
   COMMENTS             NVARCHAR2(1000),
   CREATE_DATE          DATE,
   CREATE_BY            CHAR(36),
   constraint PK_T_APPROVAL_HISTORY primary key (HISTORY_ID)
);

/*==============================================================*/
/* Table: T_DELEGATION                                          */
/*==============================================================*/
create table T_DELEGATION  (
   DELEGATION_ID        CHAR(36)                        not null,
   PROCESS_NAME         NVARCHAR2(50),
   STEP_NAME            NVARCHAR2(50),
   TASK_USER            NVARCHAR2(50),
   DELEGATOR_USER       NVARCHAR2(50),
   START_DATE           DATE,
   END_DATE             DATE,
   "COMMENT"            NVARCHAR2(300),
   CREATE_DATE          DATE,
   CREATE_BY            NVARCHAR2(50),
   UPDATE_DATE          DATE,
   UPDATE_BY            NVARCHAR2(50),
   EFFECT_FROM          DATE,
   EFFECT_TO            DATE,
   IS_ACTIVE            CHAR(1),
   DELEGATOR_STATUS     CHAR(1),
   constraint PK_T_DELEGATION primary key (DELEGATION_ID)
);

comment on column T_DELEGATION.DELEGATION_ID is
'委托ID';

comment on column T_DELEGATION.PROCESS_NAME is
'流程名称';

comment on column T_DELEGATION.STEP_NAME is
'步骤名称';

comment on column T_DELEGATION.TASK_USER is
'委托人';

comment on column T_DELEGATION.DELEGATOR_USER is
'被委托人';

comment on column T_DELEGATION.START_DATE is
'开始日期';

comment on column T_DELEGATION.END_DATE is
'结束日期';

comment on column T_DELEGATION."COMMENT" is
'备注';

comment on column T_DELEGATION.CREATE_DATE is
'创建时间';

comment on column T_DELEGATION.CREATE_BY is
'创建人';

comment on column T_DELEGATION.UPDATE_DATE is
'更新时间';

comment on column T_DELEGATION.UPDATE_BY is
'更新人';

comment on column T_DELEGATION.EFFECT_FROM is
'开始有效时间';

comment on column T_DELEGATION.EFFECT_TO is
'结束时间';

comment on column T_DELEGATION.IS_ACTIVE is
'0未激活 1已激活 2失效';

comment on column T_DELEGATION.DELEGATOR_STATUS is
'0:待确认
1:已完成
2:已取消
3:已确认生效';

/*==============================================================*/
/* Table: T_DELEGATION_TASK                                     */
/*==============================================================*/
create table T_DELEGATION_TASK  (
   DELEGATION_TASK_ID   CHAR(36)                        not null,
   PROCESS_NAME         NVARCHAR2(50),
   INCIDENT             NUMBER,
   STEP_LABEL           NVARCHAR2(50),
   RECIPIENT            NVARCHAR2(100),
   RECIPIENT_TYPE       CHAR(1),
   TASK_USER            NVARCHAR2(50),
   ASSIGNEDTO_USER      NVARCHAR2(100),
   STATUS               CHAR(1),
   START_TIME           DATE,
   END_TIME             DATE,
   SUMMARY              NVARCHAR2(50),
   TASK_NAME            NVARCHAR2(50),
   TASK_TITLE           NVARCHAR2(100),
   constraint PK_T_DELEGATION_TASK primary key (DELEGATION_TASK_ID)
);

comment on column T_DELEGATION_TASK.PROCESS_NAME is
'流程名称';

comment on column T_DELEGATION_TASK.INCIDENT is
'实例号';

comment on column T_DELEGATION_TASK.STEP_LABEL is
'步骤名称';

comment on column T_DELEGATION_TASK.RECIPIENT is
'任务接收者';

comment on column T_DELEGATION_TASK.RECIPIENT_TYPE is
'接受者类型';

comment on column T_DELEGATION_TASK.TASK_USER is
'发起人';

comment on column T_DELEGATION_TASK.ASSIGNEDTO_USER is
'处理人';

comment on column T_DELEGATION_TASK.STATUS is
'任务状态';

comment on column T_DELEGATION_TASK.START_TIME is
'开始时间';

comment on column T_DELEGATION_TASK.END_TIME is
'结束时间';

comment on column T_DELEGATION_TASK.SUMMARY is
'业务编号';

comment on column T_DELEGATION_TASK.TASK_NAME is
'任务名称';

/*==============================================================*/
/* Table: T_DEPARTMENT_INNER_TASK                               */
/*==============================================================*/
create table T_DEPARTMENT_INNER_TASK  (
   INNER_TASK_ID        CHAR(36)                        not null,
   PROCESS_NAME         NVARCHAR2(50),
   INCIDENT_NO          INT,
   TASK_ID              NVARCHAR2(50),
   INNER_TASK_NO        NVARCHAR2(50),
   TITLE                NVARCHAR2(200),
   REPLY_USERS          NVARCHAR2(1000),
   COPYTO_USERS         NVARCHAR2(1000),
   NOTIFY_TYPE          CHAR(1),
   TASK_DESCRIPTION     NVARCHAR2(1000),
   REQUIRE_REPLY_DATE   DATE,
   MESSAGE_CONTENT      NVARCHAR2(1000),
   CREATE_DATE          DATE,
   CREATE_BY            CHAR(36),
   CLOSE_DATE           DATE,
   CLOSE_BY             CHAR(36),
   CLOSE_TYPE           CHAR(1),
   CLOSE_DESCRIPTION    NVARCHAR2(1000),
   constraint PK_T_DEPARTMENT_INNER_TASK primary key (INNER_TASK_ID)
);

/*==============================================================*/
/* Table: T_DEPARTMENT_INNER_TASK_REPLY                         */
/*==============================================================*/
create table T_DEPARTMENT_INNER_TASK_REPLY  (
   REPLY_ID             CHAR(36),
   INNER_TASK_ID        CHAR(36),
   REPLY_USER_ID        CHAR(36)                        not null,
   REPLY_DATE           DATE,
   CONTENT              NVARCHAR2(1000),
   ATTACHMENT_ID        CHAR(36),
   CREATE_DATE          DATE,
   CREATE_BY            CHAR(36),
   constraint PK_T_DEPARTMENT_INNER_TASK_REP primary key (REPLY_USER_ID)
);

/*==============================================================*/
/* Table: T_DICTIONARY                                          */
/*==============================================================*/
create table T_DICTIONARY  (
   DICTIONARY_ID        CHAR(36)                        not null,
   CN_NAME              NVARCHAR2(50)                   not null,
   EN_NAME              NVARCHAR2(50),
   DICTIONARY_TYPE      NVARCHAR2(50)                   not null,
   DICTIONARY_CODE      NVARCHAR2(50),
   PARENT_DICTIONARY_ID CHAR(36),
   ORDER_NO             INT,
   CREATE_DATE          DATE,
   CREATE_BY            CHAR(36),
   UPDATE_DATE          DATE,
   UPDATE_BY            CHAR(36),
   EFFECT_FROM          DATE,
   EFFECT_TO            DATE,
   IS_ACTIVE            CHAR(1)                         not null,
   EXT01                NVARCHAR2(200),
   EXT02                NVARCHAR2(200),
   EXT03                NVARCHAR2(200),
   EXT04                NVARCHAR2(200),
   EXT05                NVARCHAR2(200),
   EXT06                NVARCHAR2(200),
   EXT07                NVARCHAR2(200),
   EXT08                NVARCHAR2(200),
   EXT09                NVARCHAR2(200),
   EXT10                NVARCHAR2(200),
   EXT11                NVARCHAR2(200),
   EXT12                NVARCHAR2(200),
   EXT13                NVARCHAR2(200),
   EXT14                NVARCHAR2(200),
   EXT15                NVARCHAR2(200),
   EXT16                NVARCHAR2(200),
   EXT17                NVARCHAR2(200),
   EXT18                NVARCHAR2(200),
   EXT19                NVARCHAR2(200),
   EXT20                NVARCHAR2(200),
   EXT21                NVARCHAR2(200),
   EXT22                NVARCHAR2(200),
   EXT23                NVARCHAR2(200),
   EXT24                NVARCHAR2(200),
   EXT25                NVARCHAR2(200),
   EXT26                NVARCHAR2(200),
   EXT27                NVARCHAR2(200),
   EXT28                NVARCHAR2(200),
   EXT29                NVARCHAR2(200),
   EXT30                NVARCHAR2(200),
   constraint PK_T_DICTIONARY primary key (DICTIONARY_ID)
);

comment on table T_DICTIONARY is
'组织:
EXT01:组织类型 1:集团公司 2:总公司 3:分支机构 4:分公司 5:部门 6:科室
EXT02:组织状态 0:正常 1：已撤销
EXT03:分管领导
EXT04:第一负责人
EXT05:第二负责人
EXT06:第三负责人
EXT07:第四负责人
EXT08:第五负责人
LDAP：
EXT10:组织地址
EXT11:EHR主键
EXT12:组织层次
EXT13:LDAP排序


菜单:
EXT01:菜单图片css
EXT02:菜单URL

职务：
EXT01:职务级别

角色:
EXT01:1-公司专业委员会、2-流程经理、3-流程经理协助人、4-服务经理、5-服务经理协助人、6-流程专员、7-知识管理员、8-流程管理方

';

comment on column T_DICTIONARY.DICTIONARY_TYPE is
'包含MENU菜单 BUTTON按钮 ORGANIZATION组织 PROCESS流程 PROCESS_CATEGORY流程分类
USERGROUP 角色 SERVICEPROJECT服务项目';

comment on column T_DICTIONARY.IS_ACTIVE is
'0:DEACTIVE 1:ACTIVE 2:DISABLE';

comment on column T_DICTIONARY.EXT01 is
'组织:
EXT01:组织类型 1:集团公司 2:总公司 3:分支机构 4:分公司 5:部门 6:科室
EXT02:组织状态 0:正常 1：已撤销
EXT03:分管领导
LDAP：
EXT10:组织地址
EXT11:EHR主键
EXT12:组织层次
EXT13:LDAP排序


菜单:
EXT01:菜单图片css
EXT02:菜单URL

职务：
EXT01:职务级别

角色:
EXT01:1-公司专业委员会、2-流程经理、3-流程经理协助人、4-服务经理、5-服务经理协助人、6-流程专员、7-知识管理员、8-流程管理方

';

/*==============================================================*/
/* Table: T_DICTIONARY_RELATION                                 */
/*==============================================================*/
create table T_DICTIONARY_RELATION  (
   RELATION_ID          CHAR(36)                        not null,
   SOURCE_DICTIONARY_ID CHAR(36)                        not null,
   DESTINATION_DICTIONARY_ID CHAR(36)                        not null,
   RELATION_TYPE        NVARCHAR2(50)                   not null,
   CREATE_BY            CHAR(36),
   CREATE_DATE          DATE,
   EXT01                NVARCHAR2(200),
   EXT02                NVARCHAR2(200),
   EXT03                NVARCHAR2(200),
   EXT04                NVARCHAR2(200),
   EXT05                NVARCHAR2(200),
   EXT06                NVARCHAR2(200),
   EXT07                NVARCHAR2(200),
   EXT08                NVARCHAR2(200),
   EXT09                NVARCHAR2(200),
   EXT10                NVARCHAR2(200),
   EXT11                NVARCHAR2(200),
   EXT12                NVARCHAR2(200),
   EXT13                NVARCHAR2(200),
   EXT14                NVARCHAR2(200),
   EXT15                NVARCHAR2(200),
   EXT16                NVARCHAR2(200),
   EXT17                NVARCHAR2(200),
   EXT18                NVARCHAR2(200),
   EXT19                NVARCHAR2(200),
   EXT20                NVARCHAR2(200),
   EXT21                NVARCHAR2(200),
   EXT22                NVARCHAR2(200),
   EXT23                NVARCHAR2(200),
   EXT24                NVARCHAR2(200),
   EXT25                NVARCHAR2(200),
   EXT26                NVARCHAR2(200),
   EXT27                NVARCHAR2(200),
   EXT28                NVARCHAR2(200),
   EXT29                NVARCHAR2(200),
   EXT30                NVARCHAR2(200),
   constraint PK_T_DICTIONARY_RELATION primary key (RELATION_ID)
);

comment on column T_DICTIONARY_RELATION.RELATION_TYPE is
'ServiceAndProcess 服务项目和流程';

/*==============================================================*/
/* Table: T_EXCEPTION_LOG                                       */
/*==============================================================*/
create table T_EXCEPTION_LOG  (
   EXCEPTION_ID         CHAR(36)                        not null,
   DOCUMENT_NUMBER      NVARCHAR2(50),
   TITLE                NVARCHAR2(50),
   EXCEPTION_TYPE       NVARCHAR2(50),
   STEP_NAME            NVARCHAR2(50),
   CLOSE_STEP_NAME      NVARCHAR2(50),
   TASK_ID              NVARCHAR2(50),
   ACTION_BY            NVARCHAR2(50),
   ACTION_DEPARTMENT    NVARCHAR2(2000),
   ACTION_DATE          DATE,
   EXCEPTOIN_REASON     NVARCHAR2(500),
   EXCEPTOIN_CONDITION  NVARCHAR2(500),
   FOLLOW_UP            NVARCHAR2(500),
   CHECK_BY             NVARCHAR2(50),
   CHECK_DATE           DATE,
   CHECK_TYPE           NVARCHAR2(50),
   CHECK_DESCRIPTION    NVARCHAR2(500),
   IS_ILLEGAL           CHAR(1),
   ILLEGAL_TIMES        DECIMAL(10,1),
   ILLEGAL_DEPARTMENT_NAME NVARCHAR2(50),
   CHECK_CONDITION      NVARCHAR2(500),
   CHECK_RESULT         NVARCHAR2(500),
   CONFIRM_BY           NVARCHAR2(50),
   CONFIRM_DATE         DATE,
   CONFIRM_TYPE         NVARCHAR2(50),
   ILLEGAL_DEPARTMENT_REASON NVARCHAR2(500),
   ARBITRATE_CONCLUSION NVARCHAR2(500),
   ARBITRATE_SIGN_BY    NVARCHAR2(50),
   ARBITRATE_SIGN_DATE  DATE,
   IS_FINIAL_CONCLUSION CHAR(1),
   constraint PK_T_EXCEPTION_LOG primary key (EXCEPTION_ID)
);

/*==============================================================*/
/* Table: T_FLOW_NUMBER                                         */
/*==============================================================*/
create table T_FLOW_NUMBER  (
   FLOWNUMBER_ID        CHAR(36)                        not null,
   CODE                 NVARCHAR2(50),
   FORMAT               NVARCHAR2(500),
   DATA                 NVARCHAR2(50),
   "LOCK"               CHAR(1),
   CREATE_DATE          DATE,
   CREATE_BY            NVARCHAR2(50),
   UPDATE_BY            NVARCHAR2(50),
   UPDATE_DATE          DATE,
   EFFECT_FROM          DATE,
   EFFECT_TO            DATE,
   IS_ACTIVE            CHAR(1),
   constraint PK_T_FLOW_NUMBER primary key (FLOWNUMBER_ID)
);

comment on column T_FLOW_NUMBER.CREATE_BY is
'创建人';

comment on column T_FLOW_NUMBER.UPDATE_BY is
'更新人';

comment on column T_FLOW_NUMBER.UPDATE_DATE is
'更新时间';

comment on column T_FLOW_NUMBER.EFFECT_FROM is
'开始有效时间';

comment on column T_FLOW_NUMBER.EFFECT_TO is
'结束时间';

comment on column T_FLOW_NUMBER.IS_ACTIVE is
'0未激活 1已激活 2失效';

/*==============================================================*/
/* Table: T_FORM                                                */
/*==============================================================*/
create table T_FORM  (
   FORM_ID              CHAR(36)                        not null,
   PROCESS_NAME         NVARCHAR2(50)                   not null,
   INCIDENT_NO          INT                             not null,
   STEP_NAME            INT,
   FORM_CODE            NVARCHAR2(50),
   TITLE                NVARCHAR2(200),
   FORM_CONTENT         XMLType,
   CREATE_DATE          DATE,
   CREATE_BY            CHAR(36),
   UPDATE_DATE          DATE,
   UPDATE_BY            CHAR(36),
   constraint PK_T_FORM primary key (FORM_ID)
);

/*==============================================================*/
/* Table: T_FORM_DRAFT                                          */
/*==============================================================*/
create table T_FORM_DRAFT  (
   DRAFT_ID             CHAR(36)                        not null,
   PROCESS_NAME         NVARCHAR2(50)                   not null,
   TITLE                NVARCHAR2(200)                  not null,
   FORM_CONTENT         XMLType,
   CREATE_DATE          DATE,
   CREATE_BY            CHAR(36)                        not null,
   constraint PK_T_FORM_DRAFT primary key (DRAFT_ID)
);

/*==============================================================*/
/* Table: T_INBOX_READ                                          */
/*==============================================================*/
create table T_INBOX_READ  (
   INBOX_ID             CHAR(36)                        not null,
   PROCESS_NAME         NVARCHAR2(50),
   INCIDENT             NUMBER,
   STEP_LABEL           NVARCHAR2(50),
   TASK_USER            NVARCHAR2(50),
   ASSIGNEDTO_USER      NVARCHAR2(300),
   STATUS               CHAR(1),
   START_TIME           DATE,
   END_TIME             DATE,
   SUMMARY              NVARCHAR2(50),
   TASK_TITLE           NVARCHAR2(100),
   TASK_NAME            NVARCHAR2(50),
   constraint PK_T_INBOX_READ primary key (INBOX_ID)
);

comment on column T_INBOX_READ.TASK_NAME is
'任务名称';

/*==============================================================*/
/* Table: T_MESSAGE                                             */
/*==============================================================*/
create table T_MESSAGE  (
   MESSAGE_ID           CHAR(36)                        not null,
   "FROM"               CHAR(36),
   "TO"                 CHAR(36),
   SUBJECT              NVARCHAR2(200),
   BODY                 NVARCHAR2(2000)                 not null,
   IS_READ              CHAR(1),
   READ_DATE            DATE,
   CREATE_DATE          DATE,
   CREATE_BY            CHAR(36),
   constraint PK_T_MESSAGE primary key (MESSAGE_ID)
);

/*==============================================================*/
/* Table: T_MESSAGE_QUEUE                                       */
/*==============================================================*/
create table T_MESSAGE_QUEUE  (
   QUEUE_ID             CHAR(36)                        not null,
   MESSAGE_TYPE         CHAR(1)                         not null,
   "FROM"               NVARCHAR2(50),
   TO_ACCOUNT           NVARCHAR2(1000)                 not null,
   TO_NAME              NVARCHAR2(1000),
   SUBJECT              NVARCHAR2(200),
   BODY                 NVARCHAR2(2000)                 not null,
   IS_SEND              CHAR(1)                         not null,
   SEND_TIME            DATE,
   RETRY_TIMES          INT,
   constraint PK_T_MESSAGE_QUEUE primary key (QUEUE_ID)
);

comment on column T_MESSAGE_QUEUE.MESSAGE_TYPE is
'0邮件 1平台内消息 2短信 3IM';

/*==============================================================*/
/* Table: T_MESSAGE_QUEUE_FINISHED                              */
/*==============================================================*/
create table T_MESSAGE_QUEUE_FINISHED  (
   FINISHED_ID          CHAR(36)                        not null,
   QUEUE_ID             CHAR(36)                        not null,
   MESSAGE_TYPE         CHAR(1)                         not null,
   "FROM"               NVARCHAR2(50),
   TO_ACCOUNT           NVARCHAR2(1000)                 not null,
   TO_NAME              NVARCHAR2(1000),
   SUBJECT              NVARCHAR2(200),
   BODY                 NVARCHAR2(2000)                 not null,
   IS_SEND              CHAR(1)                         not null,
   SEND_TIME            DATE,
   RETRY_TIMES          INT,
   CREATE_DATE          DATE,
   CREATE_BY            NVARCHAR2(50),
   constraint PK_T_MESSAGE_QUEUE_FINISHED primary key (FINISHED_ID)
);

comment on column T_MESSAGE_QUEUE_FINISHED.MESSAGE_TYPE is
'0邮件 1平台内消息 2短信 3IM';

/*==============================================================*/
/* Table: T_MESSAGE_TEMPLATE                                    */
/*==============================================================*/
create table T_MESSAGE_TEMPLATE  (
   TEMPLATE_ID          CHAR(36)                        not null,
   SUBJECT              NVARCHAR2(200)                  not null,
   BODY                 NVARCHAR2(2000)                 not null,
   CREATE_DATE          DATE,
   CREATE_BY            CHAR(36),
   UPDATE_DATE          DATE,
   UPDATE_BY            CHAR(36),
   EFFECT_FROM          DATE,
   EFFECT_TO            DATE,
   IS_ACTIVE            CHAR(1)                         not null,
   constraint PK_T_MESSAGE_TEMPLATE primary key (TEMPLATE_ID)
);

comment on column T_MESSAGE_TEMPLATE.IS_ACTIVE is
'0:DEACTIVE 1:ACTIVE 2:DISABLE';

/*==============================================================*/
/* Table: T_PERSON_SETTING                                      */
/*==============================================================*/
create table T_PERSON_SETTING  (
   SETTING_ID           CHAR(36)                        not null,
   USER_ID              CHAR(36),
   SETTING_ITEMS        NVARCHAR2(50),
   SETTING_VALUE        NVARCHAR2(50),
   SETTING_TYPE         CHAR(1),
   CREATE_DATE          DATE,
   CREATE_BY            NVARCHAR2(50),
   UPDATE_DATE          DATE,
   UPDATE_BY            NVARCHAR2(50),
   EFFECT_FROM          DATE,
   EFFECT_TO            DATE,
   IS_ACTIVE            CHAR(1),
   DELEGATOR_STATUS     CHAR(1),
   SETTING_SORT         NUMBER,
   EXT01                NVARCHAR2(50),
   EXT02                NVARCHAR2(50),
   EXT03                NVARCHAR2(50),
   EXT04                NVARCHAR2(50),
   EXT05                NVARCHAR2(50),
   EXT06                NVARCHAR2(50),
   EXT07                NVARCHAR2(50),
   EXT08                NVARCHAR2(50),
   EXT09                NVARCHAR2(50),
   EXT10                NVARCHAR2(50),
   EXT11                NVARCHAR2(50),
   EXT12                NVARCHAR2(50),
   EXT13                NVARCHAR2(50),
   EXT14                NVARCHAR2(50),
   EXT15                NVARCHAR2(50),
   constraint PK_T_PERSON_SETTING primary key (SETTING_ID)
);

comment on column T_PERSON_SETTING.SETTING_ID is
'主键ID';

comment on column T_PERSON_SETTING.USER_ID is
'员工ID';

comment on column T_PERSON_SETTING.SETTING_ITEMS is
'配置项';

comment on column T_PERSON_SETTING.SETTING_VALUE is
'配置值';

comment on column T_PERSON_SETTING.SETTING_TYPE is
'配置类型';

comment on column T_PERSON_SETTING.CREATE_DATE is
'创建时间';

comment on column T_PERSON_SETTING.CREATE_BY is
'创建人';

comment on column T_PERSON_SETTING.UPDATE_DATE is
'更新时间';

comment on column T_PERSON_SETTING.UPDATE_BY is
'更新人';

comment on column T_PERSON_SETTING.EFFECT_FROM is
'开始有效时间';

comment on column T_PERSON_SETTING.EFFECT_TO is
'结束时间';

comment on column T_PERSON_SETTING.IS_ACTIVE is
'0未激活 1已激活 2失效';

comment on column T_PERSON_SETTING.DELEGATOR_STATUS is
'0:待确认
1:已完成
2:已取消
3:已确认生效';

/*==============================================================*/
/* Table: T_PROCESS_BUSINESS_FIELDS                             */
/*==============================================================*/
create table T_PROCESS_BUSINESS_FIELDS  (
   FIELD_ID             CHAR(36)                        not null,
   PROCESS_ID           CHAR(36),
   FIELD_CNAME          NVARCHAR2(50),
   FIELD_NAME           NVARCHAR2(50),
   FIELD_TABLE_NAME     NVARCHAR2(50),
   FIELD_DATA_TYPE      NVARCHAR2(20),
   CONTROL_TYPE         NVARCHAR2(20),
   CONTROL_DATASOURCE   NVARCHAR2(500),
   CREATE_DATE          DATE,
   CREATE_BY            NVARCHAR2(50),
   UPDATE_DATE          DATE,
   UPDATE_BY            NVARCHAR2(50),
   EFFECT_FROM          DATE,
   EFFECT_TO            DATE,
   IS_ACTIVE            CHAR(1),
   EXT01                NVARCHAR2(50),
   EXT02                NVARCHAR2(50),
   EXT03                NVARCHAR2(50),
   EXT04                NVARCHAR2(50),
   EXT05                NVARCHAR2(50),
   EXT06                NVARCHAR2(50),
   EXT07                NVARCHAR2(50),
   EXT08                NVARCHAR2(50),
   EXT09                NVARCHAR2(50),
   EXT10                NVARCHAR2(50),
   constraint PK_T_PROCESS_BUSINESS_FIELDS primary key (FIELD_ID)
);

comment on column T_PROCESS_BUSINESS_FIELDS.FIELD_ID is
'字段ID';

comment on column T_PROCESS_BUSINESS_FIELDS.PROCESS_ID is
'流程ID';

comment on column T_PROCESS_BUSINESS_FIELDS.FIELD_CNAME is
'字段中文名称';

comment on column T_PROCESS_BUSINESS_FIELDS.FIELD_NAME is
'字段名称';

comment on column T_PROCESS_BUSINESS_FIELDS.FIELD_TABLE_NAME is
'表名称';

comment on column T_PROCESS_BUSINESS_FIELDS.FIELD_DATA_TYPE is
'字段类型';

comment on column T_PROCESS_BUSINESS_FIELDS.CREATE_DATE is
'创建时间';

comment on column T_PROCESS_BUSINESS_FIELDS.CREATE_BY is
'创建人';

comment on column T_PROCESS_BUSINESS_FIELDS.UPDATE_DATE is
'更新时间';

comment on column T_PROCESS_BUSINESS_FIELDS.UPDATE_BY is
'更新人';

comment on column T_PROCESS_BUSINESS_FIELDS.EFFECT_FROM is
'开始有效时间';

comment on column T_PROCESS_BUSINESS_FIELDS.EFFECT_TO is
'结束时间';

comment on column T_PROCESS_BUSINESS_FIELDS.IS_ACTIVE is
'0未激活 1已激活 2失效';

/*==============================================================*/
/* Table: T_PROCESS_CONFIG                                      */
/*==============================================================*/
create table T_PROCESS_CONFIG  (
   CONFIG_ID            CHAR(36)                        not null,
   PROCESS_NAME         NVARCHAR2(50),
   STEP_NAME            NVARCHAR2(50),
   DEPARTMENT_ID        CHAR(36),
   FORM_VIEW            NVARCHAR2(50),
   FORM_VIEWUSER        NVARCHAR2(50),
   ATTACHMENT_DOWNLOAD  NVARCHAR2(50),
   ATTACHMENT_DOWNLOADUSER NVARCHAR2(50),
   APPROVAL_SAMELEVEL   CHAR(1),
   APPROVAL_SAMELEVEL_XMLPATHID CHAR(36),
   APPROVAL_TYPE        NVARCHAR2(10),
   APPROVAL_TYPE_XMLPATH_ID CHAR(36),
   APPROVAL_MAXLEVEL    NVARCHAR2(50),
   APPROVAL_MINLEVEL    NVARCHAR2(50),
   APPROVAL_DEPARMENT_ID CHAR(36),
   DEPARMENT_ID         CHAR(36),
   DEPARTMENT_ORDER     CHAR(1),
   "IS_ FORWARD"        CHAR(1),
   FORWARD_DEPARTMENT_ID CHAR(36),
   FORWARD_TIMES        NUMBER,
   HELP_CONTENT         CHAR(36),
   CREATE_DATE          DATE,
   CREATE_BY            NVARCHAR2(50),
   UPDATE_DATE          DATE,
   UPDATE_BY            NVARCHAR2(50),
   EFFECT_FROM          DATE,
   EFFECT_TO            DATE,
   IS_ACTIVE            CHAR(1),
   EXT01                NVARCHAR2(50),
   EXT02                NVARCHAR2(50),
   EXT03                NVARCHAR2(50),
   EXT04                NVARCHAR2(50),
   EXT05                NVARCHAR2(50),
   EXT06                NVARCHAR2(50),
   EXT07                NVARCHAR2(50),
   EXT08                NVARCHAR2(50),
   EXT09                NVARCHAR2(50),
   EXT10                NVARCHAR2(50),
   EXT11                NVARCHAR2(50),
   EXT12                NVARCHAR2(50),
   EXT13                NVARCHAR2(50),
   EXT14                NVARCHAR2(50),
   EXT15                NVARCHAR2(50),
   constraint PK_T_PROCESS_CONFIG primary key (CONFIG_ID)
);

comment on column T_PROCESS_CONFIG.CONFIG_ID is
'配置ID';

comment on column T_PROCESS_CONFIG.PROCESS_NAME is
'流程名称';

comment on column T_PROCESS_CONFIG.STEP_NAME is
'步骤名称';

comment on column T_PROCESS_CONFIG.FORM_VIEW is
'表单浏览权限';

comment on column T_PROCESS_CONFIG.FORM_VIEWUSER is
'表单浏览指定账号';

comment on column T_PROCESS_CONFIG.ATTACHMENT_DOWNLOAD is
'附件浏览下载权限';

comment on column T_PROCESS_CONFIG.ATTACHMENT_DOWNLOADUSER is
'附件浏览下载指定账号';

comment on column T_PROCESS_CONFIG.APPROVAL_SAMELEVEL is
'是否可以送同级审批';

comment on column T_PROCESS_CONFIG.APPROVAL_SAMELEVEL_XMLPATHID is
'同级审批路径';

comment on column T_PROCESS_CONFIG.APPROVAL_TYPE is
'1、	无需审批
2、	指定路径强制审批
3、	不指定路径强制审批
4、	可选审批
';

comment on column T_PROCESS_CONFIG.APPROVAL_TYPE_XMLPATH_ID is
'审批路径';

comment on column T_PROCESS_CONFIG.APPROVAL_MAXLEVEL is
'1、室主管
2、二级部门总经理
3、一级部门总经理
4、公司领导
';

comment on column T_PROCESS_CONFIG.APPROVAL_MINLEVEL is
'1、室主管
2、二级部门总经理
3、一级部门总经理
4、公司领导
';

comment on column T_PROCESS_CONFIG.APPROVAL_DEPARMENT_ID is
'多级审批设置部门';

comment on column T_PROCESS_CONFIG.DEPARMENT_ID is
'部门工单部门';

comment on column T_PROCESS_CONFIG.DEPARTMENT_ORDER is
'是否可发起部门工单';

comment on column T_PROCESS_CONFIG."IS_ FORWARD" is
'是否可以转交';

comment on column T_PROCESS_CONFIG.FORWARD_DEPARTMENT_ID is
'转交部门';

comment on column T_PROCESS_CONFIG.FORWARD_TIMES is
'转交限制';

comment on column T_PROCESS_CONFIG.HELP_CONTENT is
'流程帮助内容';

comment on column T_PROCESS_CONFIG.CREATE_DATE is
'创建时间';

comment on column T_PROCESS_CONFIG.CREATE_BY is
'创建人';

comment on column T_PROCESS_CONFIG.UPDATE_DATE is
'更新时间';

comment on column T_PROCESS_CONFIG.UPDATE_BY is
'更新人';

comment on column T_PROCESS_CONFIG.EFFECT_FROM is
'开始有效时间';

comment on column T_PROCESS_CONFIG.EFFECT_TO is
'结束时间';

comment on column T_PROCESS_CONFIG.IS_ACTIVE is
'0未激活 1已激活 2失效';

/*==============================================================*/
/* Table: T_PROCESS_CONFIG_DATAFIELDS                           */
/*==============================================================*/
create table T_PROCESS_CONFIG_DATAFIELDS  (
   DATAFIELDS_ID        CHAR(36)                        not null,
   CONFIG_ID            CHAR(36),
   FIELD_ID             CHAR(36),
   CREATE_DATE          DATE,
   CREATE_BY            NVARCHAR2(50),
   UPDATE_DATE          DATE,
   UPDATE_BY            NVARCHAR2(50),
   EFFECT_FROM          DATE,
   EFFECT_TO            DATE,
   IS_ACTIVE            CHAR(1),
   constraint PK_T_PROCESS_CONFIG_DATAFIELDS primary key (DATAFIELDS_ID)
);

comment on column T_PROCESS_CONFIG_DATAFIELDS.DATAFIELDS_ID is
'主键ID';

comment on column T_PROCESS_CONFIG_DATAFIELDS.CONFIG_ID is
'配置主表ID';

comment on column T_PROCESS_CONFIG_DATAFIELDS.FIELD_ID is
'字段表ID';

comment on column T_PROCESS_CONFIG_DATAFIELDS.CREATE_DATE is
'创建时间';

comment on column T_PROCESS_CONFIG_DATAFIELDS.CREATE_BY is
'创建人';

comment on column T_PROCESS_CONFIG_DATAFIELDS.UPDATE_DATE is
'更新时间';

comment on column T_PROCESS_CONFIG_DATAFIELDS.UPDATE_BY is
'更新人';

comment on column T_PROCESS_CONFIG_DATAFIELDS.EFFECT_FROM is
'开始有效时间';

comment on column T_PROCESS_CONFIG_DATAFIELDS.EFFECT_TO is
'结束时间';

comment on column T_PROCESS_CONFIG_DATAFIELDS.IS_ACTIVE is
'0未激活 1已激活 2失效';

/*==============================================================*/
/* Table: T_PROCESS_CONFIG_MULTI_PATH                           */
/*==============================================================*/
create table T_PROCESS_CONFIG_MULTI_PATH  (
   PATH_ID              CHAR(36)                        not null,
   XMLPATH              XMLType,
   CREATE_DATE          DATE,
   CREATE_BY            NVARCHAR2(50),
   UPDATE_DATE          DATE,
   UPDATE_BY            NVARCHAR2(50),
   EFFECT_FROM          DATE,
   EFFECT_TO            DATE,
   IS_ACTIVE            CHAR(1),
   constraint PK_T_PROCESS_CONFIG_MULTI_PATH primary key (PATH_ID)
);

comment on column T_PROCESS_CONFIG_MULTI_PATH.PATH_ID is
'审批路径主键';

comment on column T_PROCESS_CONFIG_MULTI_PATH.XMLPATH is
'审批路径';

comment on column T_PROCESS_CONFIG_MULTI_PATH.CREATE_DATE is
'创建时间';

comment on column T_PROCESS_CONFIG_MULTI_PATH.CREATE_BY is
'创建人';

comment on column T_PROCESS_CONFIG_MULTI_PATH.UPDATE_DATE is
'更新时间';

comment on column T_PROCESS_CONFIG_MULTI_PATH.UPDATE_BY is
'更新人';

comment on column T_PROCESS_CONFIG_MULTI_PATH.EFFECT_FROM is
'开始有效时间';

comment on column T_PROCESS_CONFIG_MULTI_PATH.EFFECT_TO is
'结束时间';

comment on column T_PROCESS_CONFIG_MULTI_PATH.IS_ACTIVE is
'0未激活 1已激活 2失效';

/*==============================================================*/
/* Table: T_PROCESS_CONFIG_NOTIFICATION                         */
/*==============================================================*/
create table T_PROCESS_CONFIG_NOTIFICATION  (
   NOTIFICATION_ID      CHAR(36)                        not null,
   CONFIG_ID            CHAR(36),
   CONFIG_TYPE          CHAR(1),
   MESSAGE_TYPE         NVARCHAR2(20),
   INITIATOR            CHAR(1),
   NEXT_APPROVE         CHAR(1),
   PROCESS_MANAGER      CHAR(1),
   STEP_PARTICIPANT     CHAR(1),
   IS_FORM_DATAFIELD    CHAR(1),
   FORM_DATAFIELD       NVARCHAR2(100),
   IS_DESIGNATED_OFFICER CHAR(1),
   DESIGNATED_OFFICER   NVARCHAR2(50),
   REMIND_TYPE          NVARCHAR2(300),
   constraint PK_T_PROCESS_CONFIG_NOTIFICATI primary key (NOTIFICATION_ID)
);

comment on column T_PROCESS_CONFIG_NOTIFICATION.CONFIG_TYPE is
'0:所有流程
1:指定流程
2:步骤';

comment on column T_PROCESS_CONFIG_NOTIFICATION.MESSAGE_TYPE is
'消息类型';

comment on column T_PROCESS_CONFIG_NOTIFICATION.INITIATOR is
'发起人';

comment on column T_PROCESS_CONFIG_NOTIFICATION.NEXT_APPROVE is
'下一步骤发起人';

comment on column T_PROCESS_CONFIG_NOTIFICATION.PROCESS_MANAGER is
'流程经理';

comment on column T_PROCESS_CONFIG_NOTIFICATION.STEP_PARTICIPANT is
'节点参与人';

comment on column T_PROCESS_CONFIG_NOTIFICATION.FORM_DATAFIELD is
'表单字段';

comment on column T_PROCESS_CONFIG_NOTIFICATION.DESIGNATED_OFFICER is
'指定人员';

comment on column T_PROCESS_CONFIG_NOTIFICATION.REMIND_TYPE is
'提醒方式';

/*==============================================================*/
/* Table: T_PROCESS_DATA_LOG                                    */
/*==============================================================*/
create table T_PROCESS_DATA_LOG  (
   LOG_ID               CHAR(36)                        not null,
   PROCESS_NAME         NVARCHAR2(50),
   INCIDENT_NO          INT,
   STEP_NAME            NVARCHAR2(50),
   TASK_ID              NVARCHAR2(50),
   SEND_USER_ID         CHAR(36),
   SEND_USER_NAME       NVARCHAR2(50),
   SEND_DEPARTMENT_NAME NVARCHAR2(50),
   SEND_DATE            DATE,
   SUBMIT_DATE          DATE,
   HAS_STANDARD_TIME    CHAR(1),
   STANDARD_TIME        INT,
   DEADLINE_DATE        DATE,
   IS_TIMEOUT           CHAR(1),
   HANDLE_USER_ID       CHAR(36),
   HANDLE_USER_NAME     NVARCHAR2(50),
   HANDLE_DEPARTMENT_NAME NVARCHAR2(50),
   PRCESS_ROLE_NAME     NVARCHAR2(50),
   RECEIVE_DEPARTMENT_NAME NVARCHAR2(500),
   RECEIVE_USER_NAME    NVARCHAR2(500),
   IS_COPYTO            CHAR(1),
   COPYTO_DEPARTMENT_NAME NVARCHAR2(500),
   COPYTO_USER_NAME     NVARCHAR2(500),
   IS_SENTTO_LEADER     CHAR(1),
   LEADER_NAME          NVARCHAR2(50),
   LEADER_RESULT        NVARCHAR2(500),
   LEADER_COMMENTS      NVARCHAR2(500),
   IS_REDIRECT          CHAR(1),
   REDIRECT_USER_NAME   NVARCHAR2(50),
   REDIRECT_DEPARTMENT_NAME NVARCHAR2(50),
   IS_REASSIGN          CHAR(1),
   REASSIGN_USER_NAME   NVARCHAR2(50),
   REASSIGN_DEPARTMENT_NAME NVARCHAR2(50),
   IS_DELEGATION        CHAR(1),
   DELEGATION_USER_NAME NVARCHAR2(50),
   DELEGATION_DEPARTMENT_NAME NVARCHAR2(50),
   IS_CALLBACK          CHAR(1),
   IS_REJECT            CHAR(1),
   IS_ABORT             CHAR(1),
   COMMENTS             NVARCHAR2(500),
   ACTION_NAME          NVARCHAR2(50),
   ACTION_COMMENTS      NVARCHAR2(500),
   IS_CHILD_PROCESS     CHAR(1),
   PARENT_PROCESS_NAME  NVARCHAR2(50),
   PARENT_INCIDENT_NO   INT,
   PARENT_STEP_NAME     NVARCHAR2(50),
   PARENT_TASK_ID       NVARCHAR2(50),
   FLD001               NVARCHAR2(500),
   FLD002               NVARCHAR2(500),
   FLD003               NVARCHAR2(500),
   FLD004               NVARCHAR2(500),
   FLD005               NVARCHAR2(500),
   FLD006               NVARCHAR2(500),
   FLD007               NVARCHAR2(500),
   FLD008               NVARCHAR2(500),
   FLD009               NVARCHAR2(500),
   FLD010               NVARCHAR2(500),
   FLD011               NVARCHAR2(500),
   FLD012               NVARCHAR2(500),
   FLD013               NVARCHAR2(500),
   FLD014               NVARCHAR2(500),
   FLD015               NVARCHAR2(500),
   FLD016               NVARCHAR2(500),
   FLD017               NVARCHAR2(500),
   FLD018               NVARCHAR2(500),
   FLD019               NVARCHAR2(500),
   FLD020               NVARCHAR2(500),
   FLD021               NVARCHAR2(500),
   FLD022               NVARCHAR2(500),
   FLD023               NVARCHAR2(500),
   FLD024               NVARCHAR2(500),
   FLD025               NVARCHAR2(500),
   FLD026               NVARCHAR2(500),
   FLD027               NVARCHAR2(500),
   FLD028               NVARCHAR2(500),
   FLD029               NVARCHAR2(500),
   FLD030               NVARCHAR2(500),
   FLD031               NVARCHAR2(500),
   FLD032               NVARCHAR2(500),
   FLD033               NVARCHAR2(500),
   FLD034               NVARCHAR2(500),
   FLD035               NVARCHAR2(500),
   FLD036               NVARCHAR2(500),
   FLD037               NVARCHAR2(500),
   FLD038               NVARCHAR2(500),
   FLD039               NVARCHAR2(500),
   FLD040               NVARCHAR2(500),
   FLD041               NVARCHAR2(500),
   FLD042               NVARCHAR2(500),
   FLD043               NVARCHAR2(500),
   FLD044               NVARCHAR2(500),
   FLD045               NVARCHAR2(500),
   FLD046               NVARCHAR2(500),
   FLD047               NVARCHAR2(500),
   FLD048               NVARCHAR2(500),
   FLD049               NVARCHAR2(500),
   FLD050               NVARCHAR2(500),
   FLD051               NVARCHAR2(500),
   FLD052               NVARCHAR2(500),
   FLD053               NVARCHAR2(500),
   FLD054               NVARCHAR2(500),
   FLD055               NVARCHAR2(500),
   FLD056               NVARCHAR2(500),
   FLD057               NVARCHAR2(500),
   FLD058               NVARCHAR2(500),
   FLD059               NVARCHAR2(500),
   FLD060               NVARCHAR2(500),
   FLD061               NVARCHAR2(500),
   FLD062               NVARCHAR2(500),
   FLD063               NVARCHAR2(500),
   FLD064               NVARCHAR2(500),
   FLD065               NVARCHAR2(500),
   FLD066               NVARCHAR2(500),
   FLD067               NVARCHAR2(500),
   FLD068               NVARCHAR2(500),
   FLD069               NVARCHAR2(500),
   FLD070               NVARCHAR2(500),
   FLD071               NVARCHAR2(500),
   FLD072               NVARCHAR2(500),
   FLD073               NVARCHAR2(500),
   FLD074               NVARCHAR2(500),
   FLD075               NVARCHAR2(500),
   FLD076               NVARCHAR2(500),
   FLD077               NVARCHAR2(500),
   FLD078               NVARCHAR2(500),
   FLD079               NVARCHAR2(500),
   FLD080               NVARCHAR2(500),
   FLD081               NVARCHAR2(500),
   FLD082               NVARCHAR2(500),
   FLD083               NVARCHAR2(500),
   FLD084               NVARCHAR2(500),
   FLD085               NVARCHAR2(500),
   FLD086               NVARCHAR2(500),
   FLD087               NVARCHAR2(500),
   FLD088               NVARCHAR2(500),
   FLD089               NVARCHAR2(500),
   FLD090               NVARCHAR2(500),
   FLD091               NVARCHAR2(500),
   FLD092               NVARCHAR2(500),
   FLD093               NVARCHAR2(500),
   FLD094               NVARCHAR2(500),
   FLD095               NVARCHAR2(500),
   FLD096               NVARCHAR2(500),
   FLD097               NVARCHAR2(500),
   FLD098               NVARCHAR2(500),
   FLD099               NVARCHAR2(500),
   FLD100               NVARCHAR2(500),
   FLD101               NVARCHAR2(500),
   FLD102               NVARCHAR2(500),
   FLD103               NVARCHAR2(500),
   FLD104               NVARCHAR2(500),
   FLD105               NVARCHAR2(500),
   FLD106               NVARCHAR2(500),
   FLD107               NVARCHAR2(500),
   FLD108               NVARCHAR2(500),
   FLD109               NVARCHAR2(500),
   FLD110               NVARCHAR2(500),
   FLD111               NVARCHAR2(500),
   FLD112               NVARCHAR2(500),
   FLD113               NVARCHAR2(500),
   FLD114               NVARCHAR2(500),
   FLD115               NVARCHAR2(500),
   FLD116               NVARCHAR2(500),
   FLD117               NVARCHAR2(500),
   FLD118               NVARCHAR2(500),
   FLD119               NVARCHAR2(500),
   FLD120               NVARCHAR2(500),
   FLD121               NVARCHAR2(500),
   FLD122               NVARCHAR2(500),
   FLD123               NVARCHAR2(500),
   FLD124               NVARCHAR2(500),
   FLD125               NVARCHAR2(500),
   FLD126               NVARCHAR2(500),
   FLD127               NVARCHAR2(500),
   FLD128               NVARCHAR2(500),
   FLD129               NVARCHAR2(500),
   FLD130               NVARCHAR2(500),
   FLD131               NVARCHAR2(500),
   FLD132               NVARCHAR2(500),
   FLD133               NVARCHAR2(500),
   FLD134               NVARCHAR2(500),
   FLD135               NVARCHAR2(500),
   FLD136               NVARCHAR2(500),
   FLD137               NVARCHAR2(500),
   FLD138               NVARCHAR2(500),
   FLD139               NVARCHAR2(500),
   FLD140               NVARCHAR2(500),
   FLD141               NVARCHAR2(500),
   FLD142               NVARCHAR2(500),
   FLD143               NVARCHAR2(500),
   FLD144               NVARCHAR2(500),
   FLD145               NVARCHAR2(500),
   FLD146               NVARCHAR2(500),
   FLD147               NVARCHAR2(500),
   FLD148               NVARCHAR2(500),
   FLD149               NVARCHAR2(500),
   FLD150               NVARCHAR2(500),
   FLD151               NVARCHAR2(500),
   FLD152               NVARCHAR2(500),
   FLD153               NVARCHAR2(500),
   FLD154               NVARCHAR2(500),
   FLD155               NVARCHAR2(500),
   FLD156               NVARCHAR2(500),
   FLD157               NVARCHAR2(500),
   FLD158               NVARCHAR2(500),
   FLD159               NVARCHAR2(500),
   FLD160               NVARCHAR2(500),
   FLD161               NVARCHAR2(500),
   FLD162               NVARCHAR2(500),
   FLD163               NVARCHAR2(500),
   FLD164               NVARCHAR2(500),
   FLD165               NVARCHAR2(500),
   FLD166               NVARCHAR2(500),
   FLD167               NVARCHAR2(500),
   FLD168               NVARCHAR2(500),
   FLD169               NVARCHAR2(500),
   FLD170               NVARCHAR2(500),
   FLD171               NVARCHAR2(500),
   FLD172               NVARCHAR2(500),
   FLD173               NVARCHAR2(500),
   FLD174               NVARCHAR2(500),
   FLD175               NVARCHAR2(500),
   FLD176               NVARCHAR2(500),
   FLD177               NVARCHAR2(500),
   FLD178               NVARCHAR2(500),
   FLD179               NVARCHAR2(500),
   FLD180               NVARCHAR2(500),
   FLD181               NVARCHAR2(500),
   FLD182               NVARCHAR2(500),
   FLD183               NVARCHAR2(500),
   FLD184               NVARCHAR2(500),
   FLD185               NVARCHAR2(500),
   FLD186               NVARCHAR2(500),
   FLD187               NVARCHAR2(500),
   FLD188               NVARCHAR2(500),
   FLD189               NVARCHAR2(500),
   FLD190               NVARCHAR2(500),
   FLD191               NVARCHAR2(500),
   FLD192               NVARCHAR2(500),
   FLD193               NVARCHAR2(500),
   FLD194               NVARCHAR2(500),
   FLD195               NVARCHAR2(500),
   FLD196               NVARCHAR2(500),
   FLD197               NVARCHAR2(500),
   FLD198               NVARCHAR2(500),
   FLD199               NVARCHAR2(500),
   FLD200               NVARCHAR2(500),
   constraint PK_T_PROCESS_DATA_LOG primary key (LOG_ID)
);

/*==============================================================*/
/* Table: T_REMIND_LOG                                          */
/*==============================================================*/
create table T_REMIND_LOG  (
   LOG_ID               CHAR(36)                        not null,
   PROCESS_NAME         NVARCHAR2(50),
   INCIDENT_NO          INT,
   STEP_NAME            NVARCHAR2(50),
   TASK_ID              NVARCHAR2(50),
   REMIND_BY            NVARCHAR2(50),
   REMIND_DATE          DATE,
   RECEIVE_USER_ID      NVARCHAR2(50),
   RECEIVE_USER_NAME    NVARCHAR2(50),
   REMIND_TYPE          CHAR(1),
   constraint PK_T_REMIND_LOG primary key (LOG_ID)
);

comment on column T_REMIND_LOG.REMIND_TYPE is
'预留';

/*==============================================================*/
/* Table: T_SYSTEM_LOG                                          */
/*==============================================================*/
create table T_SYSTEM_LOG  (
   LOG_ID               CHAR,
   ACTION_BY            NVARCHAR2(50),
   COMMENTS             NVARCHAR2(300),
   SYSTEM_TYPE          CHAR(1),
   SYSTEM_DATE          DATE,
   SYSTEM_STATUS        CHAR(1),
   EXT01                NVARCHAR2(50),
   EXT02                NVARCHAR2(50),
   EXT03                NVARCHAR2(50),
   EXT04                NVARCHAR2(50),
   EXT05                NVARCHAR2(50),
   EXT06                NVARCHAR2(50),
   EXT07                NVARCHAR2(50),
   EXT08                NVARCHAR2(50),
   EXT09                NVARCHAR2(50),
   EXT10                NVARCHAR2(50),
   EXT11                NVARCHAR2(50),
   EXT12                NVARCHAR2(50),
   EXT13                NVARCHAR2(50),
   EXT14                NVARCHAR2(50),
   EXT15                NVARCHAR2(50)
);

comment on column T_SYSTEM_LOG.LOG_ID is
'系统日志主键';

comment on column T_SYSTEM_LOG.ACTION_BY is
'操作人';

comment on column T_SYSTEM_LOG.COMMENTS is
'操作内容';

comment on column T_SYSTEM_LOG.SYSTEM_TYPE is
'操作类型';

comment on column T_SYSTEM_LOG.SYSTEM_DATE is
'操作日期';

comment on column T_SYSTEM_LOG.SYSTEM_STATUS is
'操作状态';

/*==============================================================*/
/* Table: T_TASKS                                               */
/*==============================================================*/
create table T_TASKS  (
   TASK_ID              CHAR(36)                        not null,
   PROCESS_NAME         NVARCHAR2(50),
   PROCESS_VERSION      CHAR(10),
   INCIDENT             NUMBER,
   STEP_LABEL           NVARCHAR2(50),
   RECIPIENT            NVARCHAR2(1000),
   RECIPIENT_TYPE       CHAR(1),
   TASK_USER            NVARCHAR2(50),
   ASSIGNEDTO_USER      NVARCHAR2(50),
   STATUS               CHAR(1),
   SUBSTATUS            CHAR(1),
   START_TIME           DATE,
   END_TIME             DATE,
   QSTART_TIME          DATE,
   QEND_TIME            DATE,
   DELAY_TIME           DATE,
   OVERDUE_TIME         DATE,
   URGENTDUE_TIME       DATE,
   TASK_RATE            DATE,
   TASK_TIME            NUMBER,
   COST                 FLOAT,
   HELP_URL             NVARCHAR2(200),
   NOTES                NVARCHAR2(1000),
   REFERER              NVARCHAR2(50),
   SUMMARY              NVARCHAR2(50),
   TASK_TITLE           NVARCHAR2(100),
   TASK_NAME            NVARCHAR2(50),
   constraint PK_T_TASKS primary key (TASK_ID)
);

comment on column T_TASKS.TASK_ID is
'任务主键';

comment on column T_TASKS.PROCESS_NAME is
'流程名称';

comment on column T_TASKS.PROCESS_VERSION is
'流程版本号';

comment on column T_TASKS.INCIDENT is
'实例号';

comment on column T_TASKS.STEP_LABEL is
'步骤名称';

comment on column T_TASKS.RECIPIENT is
'任务接收者';

comment on column T_TASKS.RECIPIENT_TYPE is
'接受者类型';

comment on column T_TASKS.TASK_USER is
'发起人';

comment on column T_TASKS.ASSIGNEDTO_USER is
'处理人';

comment on column T_TASKS.STATUS is
'任务状态';

comment on column T_TASKS.SUBSTATUS is
'子状态';

comment on column T_TASKS.START_TIME is
'开始时间';

comment on column T_TASKS.END_TIME is
'结束时间';

comment on column T_TASKS.QSTART_TIME is
'查询开始时间';

comment on column T_TASKS.QEND_TIME is
'查询结束时间';

comment on column T_TASKS.DELAY_TIME is
'延迟时间';

comment on column T_TASKS.OVERDUE_TIME is
'超时';

comment on column T_TASKS.URGENTDUE_TIME is
'Task Urgent due time';

comment on column T_TASKS.TASK_RATE is
'Task rate of task';

comment on column T_TASKS.TASK_TIME is
'任务次数';

comment on column T_TASKS.COST is
'COST';

comment on column T_TASKS.HELP_URL is
'帮助URL';

comment on column T_TASKS.NOTES is
'备注';

comment on column T_TASKS.REFERER is
'服务器';

comment on column T_TASKS.SUMMARY is
'业务编号';

comment on column T_TASKS.TASK_NAME is
'任务名称';

/*==============================================================*/
/* Table: T_TASK_COMPLETED                                      */
/*==============================================================*/
create table T_TASK_COMPLETED  (
   TASK_ID              CHAR(36)                        not null,
   PROCESS_NAME         NVARCHAR2(50),
   PROCESS_VERSION      CHAR(10),
   INCIDENT             NUMBER,
   STEP_LABEL           NVARCHAR2(50),
   RECIPIENT            NVARCHAR2(100),
   RECIPIENT_TYPE       CHAR(1),
   TASK_USER            NVARCHAR2(50),
   ASSIGNEDTO_USER      NVARCHAR2(100),
   STATUS               CHAR(1),
   SUBSTATUS            CHAR(1),
   START_TIME           DATE,
   END_TIME             DATE,
   SUMMARY              NVARCHAR2(50),
   OPERAT_TYPE          CHAR(1),
   TASK_TITLE           NVARCHAR2(100),
   TASK_NAME            NVARCHAR2(50),
   constraint PK_T_TASK_COMPLETED primary key (TASK_ID)
);

comment on column T_TASK_COMPLETED.TASK_ID is
'任务主键';

comment on column T_TASK_COMPLETED.PROCESS_NAME is
'流程名称';

comment on column T_TASK_COMPLETED.PROCESS_VERSION is
'流程版本号';

comment on column T_TASK_COMPLETED.INCIDENT is
'实例号';

comment on column T_TASK_COMPLETED.STEP_LABEL is
'步骤名称';

comment on column T_TASK_COMPLETED.RECIPIENT is
'任务接收者';

comment on column T_TASK_COMPLETED.RECIPIENT_TYPE is
'接受者类型';

comment on column T_TASK_COMPLETED.TASK_USER is
'发起人';

comment on column T_TASK_COMPLETED.ASSIGNEDTO_USER is
'处理人';

comment on column T_TASK_COMPLETED.STATUS is
'任务状态';

comment on column T_TASK_COMPLETED.SUBSTATUS is
'子状态';

comment on column T_TASK_COMPLETED.START_TIME is
'开始时间';

comment on column T_TASK_COMPLETED.END_TIME is
'结束时间';

comment on column T_TASK_COMPLETED.SUMMARY is
'业务编号';

comment on column T_TASK_COMPLETED.OPERAT_TYPE is
'0=转交、1=改派';

comment on column T_TASK_COMPLETED.TASK_NAME is
'任务名称';

/*==============================================================*/
/* Table: T_TIMEOUT_LOG                                         */
/*==============================================================*/
create table T_TIMEOUT_LOG  (
   TIMEOUT_ID           CHAR(36)                        not null,
   DOCUMENT_NUMBER      NVARCHAR2(50),
   TITLE                NVARCHAR2(50),
   STEP_NAME            NVARCHAR2(50),
   ACTION_BY            NVARCHAR2(50),
   ACTION_DEPARTMENT    NVARCHAR2(2000),
   ACTION_DATE          DATE,
   TIMEOUT_HOURS        INT,
   CHECK_BY             NVARCHAR2(50),
   CHECK_DATE           DATE,
   CHECK_TYPE           NVARCHAR2(50),
   CHECK_DESCRIPTION    NVARCHAR2(500),
   IS_ILLEGAL           CHAR(1),
   ILLEGAL_TIMES        DECIMAL(10,1),
   ILLEGAL_DEPARTMENT_NAME NVARCHAR2(50),
   CHECK_CONDITION      NVARCHAR2(500),
   CHECK_RESULT         NVARCHAR2(500),
   CONFIRM_BY           NVARCHAR2(50),
   CONFIRM_DATE         DATE,
   CONFIRM_TYPE         NVARCHAR2(50),
   ILLEGAL_DEPARTMENT_REASON NVARCHAR2(500),
   ARBITRATE_CONCLUSION NVARCHAR2(500),
   ARBITRATE_SIGN_BY    NVARCHAR2(50),
   ARBITRATE_SIGN_DATE  DATE,
   IS_FINIAL_CONCLUSION CHAR(1),
   constraint PK_T_TIMEOUT_LOG primary key (TIMEOUT_ID)
);

/*==============================================================*/
/* Table: T_UPLOAD_FILE                                         */
/*==============================================================*/
create table T_UPLOAD_FILE  (
   UPLOAD_FILE_ID       CHAR(36)                        not null,
   GUID                 CHAR(36),
   UPLOAD_BY            NVARCHAR2(50),
   PROCESS_NAME         NVARCHAR2(50),
   UPLOAD_DATE          DATE,
   FILE_NAME            NVARCHAR2(50),
   FILE_SAVEPATH        NVARCHAR2(300),
   IS_ACTIVE            CHAR(1),
   UPLOAD_FILE_TYPE     CHAR(1),
   constraint PK_T_UPLOAD_FILE primary key (UPLOAD_FILE_ID)
);

comment on column T_UPLOAD_FILE.UPLOAD_FILE_ID is
'主键ID';

comment on column T_UPLOAD_FILE.GUID is
'来源GUID';

comment on column T_UPLOAD_FILE.UPLOAD_BY is
'上传者';

comment on column T_UPLOAD_FILE.PROCESS_NAME is
'流程名称';

comment on column T_UPLOAD_FILE.UPLOAD_DATE is
'上传日期';

comment on column T_UPLOAD_FILE.FILE_NAME is
'文件名称';

comment on column T_UPLOAD_FILE.FILE_SAVEPATH is
'文件存储路径';

comment on column T_UPLOAD_FILE.IS_ACTIVE is
'0未激活 1已激活 2失效';

comment on column T_UPLOAD_FILE.UPLOAD_FILE_TYPE is
'附件类型';

/*==============================================================*/
/* Table: T_USER                                                */
/*==============================================================*/
create table T_USER  (
   USER_ID              CHAR(36)                        not null,
   USER_CODE            CHAR(36),
   CN_NAME              CHAR(36)                        not null,
   EN_NAME              NVARCHAR2(50),
   AD_ACCOUNT           NVARCHAR2(50),
   EMAIL                NVARCHAR2(50),
   COMPANY_ID           CHAR(36),
   DEPARTMENT_ID        CHAR(36),
   SECTION_ID           CHAR(36),
   JOB_TITLE            CHAR(36),
   MOBILE_NO            NVARCHAR2(50),
   PASSWORD             NVARCHAR2(50),
   DIRECT_REPORT_ID     CHAR(36),
   TELEPHONE_NO         NVARCHAR2(50),
   IS_DEPARTMENT_ACCOUNT CHAR(1),
   IS_MULTI_DEPARTMENT  CHAR(1),
   SORT_NO              INT,
   CREATE_DATE          DATE,
   CREATE_BY            CHAR(36),
   UPDATE_DATE          DATE,
   UPDATE_BY            CHAR(36),
   EFFECT_FROM          DATE,
   EFFECT_TO            DATE,
   IS_ACTIVE            CHAR(1)                         not null,
   EXT01                NVARCHAR2(200),
   EXT02                NVARCHAR2(200),
   EXT03                NVARCHAR2(200),
   EXT04                NVARCHAR2(200),
   EXT05                NVARCHAR2(200),
   EXT06                NVARCHAR2(200),
   EXT07                NVARCHAR2(200),
   EXT08                NVARCHAR2(200),
   EXT09                NVARCHAR2(200),
   EXT10                NVARCHAR2(200),
   EXT11                NVARCHAR2(200),
   EXT12                NVARCHAR2(200),
   EXT13                NVARCHAR2(200),
   EXT14                NVARCHAR2(200),
   EXT15                NVARCHAR2(200),
   EXT16                NVARCHAR2(200),
   EXT17                NVARCHAR2(200),
   EXT18                NVARCHAR2(200),
   EXT19                NVARCHAR2(200),
   EXT20                NVARCHAR2(200),
   EXT21                NVARCHAR2(200),
   EXT22                NVARCHAR2(200),
   EXT23                NVARCHAR2(200),
   EXT24                NVARCHAR2(200),
   EXT25                NVARCHAR2(200),
   EXT26                NVARCHAR2(200),
   EXT27                NVARCHAR2(200),
   EXT28                NVARCHAR2(200),
   EXT29                NVARCHAR2(200),
   EXT30                NVARCHAR2(200),
   constraint PK_T_USER primary key (USER_ID)
);

comment on column T_USER.IS_DEPARTMENT_ACCOUNT is
'0:不是 1:是';

comment on column T_USER.IS_MULTI_DEPARTMENT is
'0:不是 1:是';

comment on column T_USER.IS_ACTIVE is
'0:DEACTIVE 1:ACTIVE 2:DISABLE';

/*==============================================================*/
/* Table: T_USER_RELATION                                       */
/*==============================================================*/
create table T_USER_RELATION  (
   RELATION_ID          CHAR(36)                        not null,
   USER_ID              CHAR(36),
   DICTIONARY_ID        CHAR(36)                        not null,
   RELATION_TYPE        NVARCHAR2(50),
   CREATE_DATE          DATE,
   CREATE_BY            CHAR(36),
   EXT01                NVARCHAR2(200),
   EXT02                NVARCHAR2(200),
   EXT03                NVARCHAR2(200),
   EXT04                NVARCHAR2(200),
   EXT05                NVARCHAR2(200),
   EXT06                NVARCHAR2(200),
   EXT07                NVARCHAR2(200),
   EXT08                NVARCHAR2(200),
   EXT09                NVARCHAR2(200),
   EXT10                NVARCHAR2(200),
   EXT11                NVARCHAR2(200),
   EXT12                NVARCHAR2(200),
   EXT13                NVARCHAR2(200),
   EXT14                NVARCHAR2(200),
   EXT15                NVARCHAR2(200),
   EXT16                NVARCHAR2(200),
   EXT17                NVARCHAR2(200),
   EXT18                NVARCHAR2(200),
   EXT19                NVARCHAR2(200),
   EXT20                NVARCHAR2(200),
   EXT21                NVARCHAR2(200),
   EXT22                NVARCHAR2(200),
   EXT23                NVARCHAR2(200),
   EXT24                NVARCHAR2(200),
   EXT25                NVARCHAR2(200),
   EXT26                NVARCHAR2(200),
   EXT27                NVARCHAR2(200),
   EXT28                NVARCHAR2(200),
   EXT29                NVARCHAR2(200),
   EXT30                NVARCHAR2(200),
   constraint PK_T_USER_RELATION primary key (RELATION_ID)
);

comment on column T_USER_RELATION.RELATION_TYPE is
'0:USERGROUPMEMBER 1:ORGANIZATIONMEMBER';

